<?php
 class Admin_Model_Ads extends Zend_Db_Table_Abstract{
 	protected $_name = "vms_ads";
	protected $_primary = "id";
	
	public function view(){	
		$query = $this->select()
             ->from( 'vms_ads');
		$data = $this-> fetchAll($query);
		return $data -> toArray();
	}
	
	public function view_where($id){	
		$query = $this->select()
             ->from( 'vms_ads' )
			 ->where('id = ?',$id);
		$data = $this-> fetchAll($query);
		return $data -> toArray();
	}
	
	public function add($data){
		$this->insert($data);
	}
	
	public function edit($id,$data){
		$where = "id=".$id;
		$this->update($data,$where);
	}
	
	public function lock($id,$data){
		$where = "id=".$id;
		$this->update($data,$where);
	}

}